import { useAtlasStore } from '@/store/modules/atlas';
import { bigModule, AssistModule, QuanchengBigModule, BigAssistModule } from '@/constants/components/cards';
import { useLayoutStore } from '@/store/modules/layout';
import COMPONENT_TITLES from '@/constants/components/componentsTitle';

const { moduleLeft, moduleRight } = storeToRefs(useLayoutStore());

// 动态设置模块高度
const flexStyle = computed(() => (item: { title: string }) => ({
  flex: item.title === COMPONENT_TITLES.ALARM_TYPE ? '2' : '1'
}));
const { retract } = storeToRefs(useAtlasStore());
// 点击标题触发对应模块的事件
export const useGeneral = () => {
  return {
    moduleLeft,
    moduleRight,
    bigModule,
    AssistModule,
    QuanchengBigModule,
    BigAssistModule,
    flexStyle,
    retract
  };
};
